<template>
	<view class="page">
		<view class="head">
			<view class="job-upload-avatar">
				<uni-file-picker
					limit="1"
					disable-preview
					v-model="userAvatarUrl"
					fileMediatype="image"
					mode="grid"
					:del-icon="false"
					:imageStyles="imageStyles"
					ref="resumeAvatarUrl"
					@select="resumeAvatarUrlSelect()"
				>
				<image src="/static/job/out-re1.png" mode="widthFix" style="width: 110rpx;height: 110rpx;"></image>
				</uni-file-picker>
			</view>
			<view class="job-upload-text">点击头像上传新头像</view>
		</view>
		<u-gap height="2" bgColor="#f9f9f9"></u-gap>
		<view class="body">
			<view class="job-form-list">
				<view class="job-form-item">
					<view class="job-form-item-title">
						求职类型
						<text>*</text>
					</view>
					<view class="job-form-item-content">
						<u-radio-group v-model="jobType" placement="row">
							<view class="job-form-item-content-radio"><u-radio activeColor="red" label="全职" name="1"></u-radio></view>
							<view class="job-form-item-content-radio"><u-radio activeColor="red" label="兼职" name="2"></u-radio></view>
						</u-radio-group>
					</view>
				</view>

				<u-gap height="2" bgColor="#f9f9f9"></u-gap>

				<view class="job-form-item">
					<view class="job-form-item-title">
						求职岗位
						<text>*</text>
					</view>
					<view class="job-form-item-content">
						<!-- <uni-section title="本地数据" type="line" padding style="height: calc(100vh - 100px);">
							<uni-data-picker placeholder="请选择班级" popup-title="请选择所在地区" :localdata="dataTree" v-model="classes"
								@change="onchange" @nodeclick="onnodeclick" @popupopened="onpopupopened" @popupclosed="onpopupclosed">
							</uni-data-picker>
						</uni-section> -->
						<uni-data-picker
							placeholder="请选择职位类别"
							popup-title="请选择职位类别"
							:clearIcon="false"
							:localdata="positionClassDataTree"
							v-model="positionClass"
							@change="positionOnchange"
						></uni-data-picker>
					</view>
				</view>

				<u-gap height="2" bgColor="#f9f9f9"></u-gap>
				
				<view class="job-form-item"  :style="isShowJobIntention ? '' : 'display:none;'">
					<view class="job-form-item-title">
						<!-- 求职意向
						<text>*</text> -->
					</view>
					<view class="job-form-item-content">
						<ld-select
							:value="jobIntention"
							:multiple="true"
							:list="jobIntentionClassDataTree"
							labelKey="text"
							valueKey="value"
							placeholder="请选择求职意向"
							:clearable="false"
							bgColor="#ffffff"
							selectColor="#c70000"
							@change="jobIntentionSelectChange()"
						></ld-select>
					</view>
				</view>

				<u-gap height="2" bgColor="#f9f9f9"  :style="isShowJobIntention ? '' : 'display:none;'"></u-gap>
				
				<view class="job-form-item">
					<view class="job-form-item-title">
						求职区域
						<text>*</text>
					</view>
					<view class="job-form-item-content">
						<!-- <uni-section title="本地数据" type="line" padding style="height: calc(100vh - 100px);">
							<uni-data-picker placeholder="请选择班级" popup-title="请选择所在地区" :localdata="dataTree" v-model="classes"
								@change="onchange" @nodeclick="onnodeclick" @popupopened="onpopupopened" @popupclosed="onpopupclosed">
							</uni-data-picker>
						</uni-section> -->
						<uni-data-picker
							placeholder="请选求职区域"
							popup-title="请选求职区域"
							:clearIcon="false"
							:localdata="jobAreaClassDataTree"
							split="->"
							@change="jobAreaOnchange"
						></uni-data-picker>
					</view>
				</view>

				<u-gap height="2" bgColor="#f9f9f9"></u-gap>

				<view class="job-form-item">
					<view class="job-form-item-title">
						工作经验
						<text>*</text>
					</view>
					<view class="job-form-item-content">
						<!-- <uni-section title="本地数据" type="line" padding style="height: calc(100vh - 100px);">
							<uni-data-picker placeholder="请选择班级" popup-title="请选择所在地区" :localdata="dataTree" v-model="classes"
								@change="onchange" @nodeclick="onnodeclick" @popupopened="onpopupopened" @popupclosed="onpopupclosed">
							</uni-data-picker>
						</uni-section> -->
						<uni-data-picker
							placeholder="请选工作经验"
							popup-title="请选工作经验"
							:clearIcon="false"
							:localdata="workExperienceClassDataTree"
							@change="workExperienceOnchange"
						></uni-data-picker>
					</view>
				</view>

				<u-gap height="2" bgColor="#f9f9f9"></u-gap>

				<view class="job-form-item">
					<view class="job-form-item-title">
						期望薪资
						<text>*</text>
					</view>
					<view class="job-form-item-content">
						<!-- <uni-section title="本地数据" type="line" padding style="height: calc(100vh - 100px);">
							<uni-data-picker placeholder="请选择班级" popup-title="请选择所在地区" :localdata="dataTree" v-model="classes"
								@change="onchange" @nodeclick="onnodeclick" @popupopened="onpopupopened" @popupclosed="onpopupclosed">
							</uni-data-picker>
						</uni-section> -->
						<uni-data-picker
							placeholder="请选薪资待遇"
							popup-title="请选薪资待遇"
							:clearIcon="false"
							:localdata="salaryExperienceClassDataTree"
							@change="salaryExperienceOnchange"
						></uni-data-picker>
					</view>
				</view>

				<view class="groupTitle">个人信息</view>

				<view class="job-form-item">
					<view class="job-form-item-title">
						姓名
						<text>*</text>
					</view>
					<view class="job-form-item-content">
						<u--input
							placeholder="请输入您的姓名"
							placeholderStyle="font-size: 28rpx;color: #808080;"
							style="margin-left: 10rpx;"
							v-model="userName"
							border="none"
						></u--input>
					</view>
				</view>

				<u-gap height="2" bgColor="#f9f9f9"></u-gap>

				<view class="job-form-item">
					<view class="job-form-item-title">
						性别
						<text>*</text>
					</view>
					<view class="job-form-item-content">
						<ld-select
							:list="genderClassDataTree"
							:value="gender"
							labelKey="text"
							valueKey="value"
							placeholder="请选您的性别"
							:clearable="false"
							bgColor="#ffffff"
							selectColor="#c70000"
							@change="genderSelectChange"
						></ld-select>
					</view>
				</view>

				<u-gap height="2" bgColor="#f9f9f9"></u-gap>

				<view class="job-form-item">
					<view class="job-form-item-title">
						婚姻状态
						<text>*</text>
					</view>
					<view class="job-form-item-content">
						<ld-select
							:list="maritalStatusClassDataTree"
							labelKey="text"
							valueKey="value"
							placeholder="请选您婚姻状态"
							:value="maritalStatus"
							:clearable="false"
							bgColor="#ffffff"
							selectColor="#c70000"
							@change="maritalSelectChange"
						></ld-select>
					</view>
				</view>

				<u-gap height="2" bgColor="#f9f9f9"></u-gap>

				<view class="job-form-item" @click="selectDatePicker">
					<view class="job-form-item-title">
						出生年份
						<text>*</text>
					</view>
					<view class="job-form-item-content">
						<u--input
							placeholder="请选择出生年份"
							placeholderStyle="font-size: 28rpx;color: #808080;"
							style="margin-left: 10rpx;"
							v-model="birthdayYear"
							border="none"
						></u--input>
						<jpTimePicker ref="date-time" datestype="year" :startYear="startYearValue" :endYear="endYearValue" datestring="" datesTitle="请选择出生年份" @change="dateTimeChange"></jpTimePicker>
						
					</view>
				</view>

				<u-gap height="2" bgColor="#f9f9f9"></u-gap>

				<view class="job-form-item">
					<view class="job-form-item-title">
						最高学历
						<text>*</text>
					</view>
					<view class="job-form-item-content">
						<ld-select
							:list="hieghestEducationClassDataTree"
							labelKey="text"
							valueKey="value"
							placeholder="请选择您的学历"
							:value="hieghestEducation"
							:clearable="false"
							bgColor="#ffffff"
							selectColor="#c70000"
							@change="hieghestEducationSelectChange"
						></ld-select>
					</view>
				</view>

				<u-gap height="2" bgColor="#f9f9f9"></u-gap>

				<view class="job-form-item">
					<view class="job-form-item-title">
						求职状态
						<text>*</text>
					</view>
					<view class="job-form-item-content">
						<ld-select
							:list="jobStatusClassDataTree"
							labelKey="label"
							valueKey="value"
							placeholder="请选择求职状态"
							v-model="jobStatus"
							:clearable="false"
							bgColor="#ffffff"
							selectColor="#c70000"
							@change="jobStatusSelectChange"
						></ld-select>
					</view>
				</view>

				<u-gap height="2" bgColor="#f9f9f9"></u-gap>

				<view class="job-form-item">
					<view class="job-form-item-title">
						联系电话
						<text>*</text>
					</view>
					<view class="job-form-item-content">
						<u--input
							placeholder="请输入您的电话"
							placeholderStyle="font-size: 28rpx;color: #808080;"
							style="margin-left: 10rpx;"
							v-model="userPhone"
							border="none"
						></u--input>
					</view>
				</view>

				<u-gap height="2" bgColor="#f9f9f9"></u-gap>

				<view class="job-form-item">
					<view class="job-form-item-title">
						简历置顶
						<text>*</text>
					</view>
					<view class="job-form-item-content">
						<ld-select
							:list="resumeTopTimeClassDataTree"
							labelKey="text"
							valueKey="value"
							placeholder="请选择置顶时间"
							:value="resumeTopTime"
							:clearable="false"
							bgColor="#ffffff"
							selectColor="#c70000"
							@change="resumeTopTimeSelectChange"
						></ld-select>
					</view>
				</view>

				<view class="groupTitle">
					工作经历
					<text>*</text>
				</view>
				<view class="groupContent">
					<u--textarea
						v-model="workExperienceContent"
						placeholder="请填写您的工作经历，利于招聘企业快速搜索（内容务必真实）建议不少于5个字"
						placeholderStyle="font-size: 28rpx;color: #808080;"
						@blur="checkTextContent"></u--textarea>
					
				</view>

				<view class="groupTitle">
					教育经验
					<text>*</text>
				</view>
				<view class="groupContent">
					<u--textarea
						v-model="educationExperienceContent"
						placeholder="请填写您的教育经历，建议不少于5个字"
						placeholderStyle="font-size: 28rpx;color: #808080;"
						@blur="checkTextContent"></u--textarea>
				</view>

				<view class="groupTitle">
					自我描述
					<text>*</text>
				</view>
				<view class="groupContent">
					<u--textarea
						v-model="selfDescriptionContent"
						placeholder="请填写您的自我描述，建议不少于5个字"
						placeholderStyle="font-size: 28rpx;color: #808080;"
						@blur="checkTextContent"></u--textarea>
				</view>

				<view class="groupTitle">简历公开范围（公开简历可以让更多的企业看到）</view>
				<view class="groupContent">
					<u-radio-group v-model="scopOfDisclosure" iconPlacement="right" placement="column" labelColor="#000000">
						<view class="groupContentIColumntem"><u-radio activeColor="#c8000a" label="平台所有企业可见" name="1"></u-radio></view>
						<u-gap height="2" bgColor="#f9f9f9"></u-gap>
						<view class="groupContentIColumntem"><u-radio activeColor="#c8000a" label="投递企业可见" name="2"></u-radio></view>
					</u-radio-group>
				</view>
				<u-gap height="2" bgColor="#f9f9f9"></u-gap>

				<!-- <view class="job-form-item-column">
					<view class="job-form-item-column-title"></view>
					<view class="job-form-item-column-content"></view>
				</view> -->
				<view class="job-post-subimt" @click="$u.throttle(infoSubmit, 2000)"><u-button type="primary" text="发布"></u-button></view>
			</view>
		</view>
		<view class="bottom u-safe-bottom u-safe-area-inset-bottom"></view>
		<QuickMessage ref="message"></QuickMessage>
	</view>
</template>

<script>
import ldSelect from '@/components/ld-select/ld-select.vue';
import jpTimePicker from '@/components/jp-timePicker/jp-timePicker.vue';
import QuickMessage from '@/components/quick-message/quick-message.vue';
export default {
	data() {
		return {
			imageStyles: {
				width: '140rpx',
				height: '140rpx',
				border: {
					width: '0rpx',
				}
			},
			userAvatarUrl: [],	// 用户头像
			jobType: '1',
			positionClass: '',	// 求职岗位选择值
			positionClassDataTree: [], // 求职岗位列有
			tempPositionList: [], // 临时存储职位列表
			isShowJobIntention: false, // 是否显示求职意向
			jobIntention: [], // 求职意向选择值，必须用数组
			jobIntentionClassDataTree: [],	// 求职意向列表
			jobCity: '',		// 求职区域选择市的值ID
			jobArea: '',	// 求职区域选择区的值ID
			jobAreaClassDataTree: [],	// 求职区域列表
			workExperience: '',	// 工作经验的选择值
			workExperienceClassDataTree: [],	// 工作经验列表
			salaryExperience: '',	// 期望薪资的值ID
			salaryExperienceClassDataTree: [],	// 期望薪资列表
			userName: '',	// 姓名
			gender: '',	// 性别选择的值
			genderClassDataTree: [
				{
					value: 2,
					text: '男'
				},
				{
					value: 1,
					text: '女'
				}
			], // 性别选择列表
			maritalStatus: '', // 婚姻状态选择的值
			maritalStatusClassDataTree: [
				{
					value: 1,
					text: '未婚'
				},
				{
					value: 2,
					text: '已婚'
				},
				// {
				// 	value: 3,
				// 	label: '离异'
				// },
				// {
				// 	value: 4,
				// 	label: '丧偶'
				// }
			], // 婚姻状态列表
			birthdayYear: '',	// 出生年份
			hieghestEducation: '', // 最高学历选择值
			hieghestEducationClassDataTree: [],	// 最新学历列表
			jobStatus: '',	// 求职状态选择值
			jobStatusClassDataTree: [
				{
					value: 1,
					label: '目前在职'
				},
				{
					value: 2,
					label: '已经离职'
				},
				// {
				// 	value: 3,
				// 	label: '离职中'
				// }
			],	// 求职状态列表
			userPhone: '',
			resumeTopTime: '',	// 置顶时间选择值
			resumeTopTimeClassDataTree: [
				{
					text: '不置顶',
					value: 0,
				}
			],	// 置顶时间列表
			workExperienceContent: '', // 工作经历证
			educationExperienceContent: '',	// 教育经历
			selfDescriptionContent: '',	// 自我描述
			scopOfDisclosure: '1', // 简历可见范围
			infoParams: { openid: getApp().globalData.openid, cid: getApp().globalData.cityId }, // 传递参数组合对象
			isSubmit: true,
		};
	},
	onLoad() {
		this.getJobPostResume();
	},
	methods: {
		getJobPostResume() {
			this.$api.getJobPostResume(this.infoParams).then(res => {
				console.log(res);
				// 组合求职岗位菜单
				this.tempPositionList = res.data.ZhiWeiList; // 临时存储职位列表
				for (let positionItem of res.data.ZhiWeiList) {
					this.positionClassDataTree.push({
						text: positionItem.ClassName,
						value: positionItem.ID
					});
				}
				// 组合求职区域菜单
				for(let cityItem of res.data.DiYuList) {
					let itemCity={
						text: cityItem.Name,
						value: cityItem.ID,
						children: []
					}
					let itemArea= []
					for(let areaItem of cityItem.ddtype_lst) {
						itemArea.push({
							text: areaItem.dd_name,
							value: areaItem.dd_id
						})
					}
					itemCity.children = itemArea
					this.jobAreaClassDataTree.push(itemCity)
				}
				
				// 组合工作经验菜单
				for(let workExperienceItem of res.data.GZjyList) {
					this.workExperienceClassDataTree.push({
						value: workExperienceItem.ID,
						text: workExperienceItem.JYName,
					})
				}
				
				// 组合期望薪资菜单
				for(let salaryExperienceItem of res.data.XZList) {
					this.salaryExperienceClassDataTree.push({
						value: salaryExperienceItem.ID,
						text: salaryExperienceItem.XZName,
					})
				}
				
				// 组合最高学历列表
				for(let hieghestEducationItem of res.data.XLList) {
					this.hieghestEducationClassDataTree.push({
						value: hieghestEducationItem.ID,
						text: hieghestEducationItem.XLName
					})
				}
				
				// 组合联系电话
				this.userPhone = res.data.Phone
				
				//组合简历置顶列表
				for(let resumeTopTimeItem of res.data.ZDList) {
					this.resumeTopTimeClassDataTree.push({
						value: resumeTopTimeItem.ID,
						text: resumeTopTimeItem.Title + '（'+ resumeTopTimeItem.Price +'元）'
					})
				}
			});
		},
		// 求职岗位修改时，组合求职意向菜单
		positionOnchange(e) {
			this.isShowJobIntention = true
			this.jobIntentionClassDataTree = []; // 求职意向菜单
			for (let positionItem of this.tempPositionList) {
				if (positionItem.ID == e.detail.value[0].value) {
					for (let intentionItem of positionItem.zwtype_lst) {
						this.jobIntentionClassDataTree.push({
							text: intentionItem.zw_name,
							value: intentionItem.zw_id
						});
					}
				}
			}
		},
		// 选择求职意向的值，数组
		jobIntentionSelectChange(val) {
			this.jobIntention = val;
		},
		// 选择求职区域的值
		jobAreaOnchange(e) {
			this.jobCity = e.detail.value[0].value	// 求职区域选择市的值ID
			this.jobArea = e.detail.value[1].value	// 求职区域选择区的值ID
		},
		// 选择工作经验的值
		workExperienceOnchange(e) {
			this.workExperience = e.detail.value[0].value	// 工作经验选择的值ID
		},
		// 选择期望薪资的值
		salaryExperienceOnchange(e) {
			this.salaryExperience = e.detail.value[0].value	// 工作经验选择的值ID
		},
		// 选择性别的值
		genderSelectChange(val) {
			this.gender = val;
		},
		// 选择婚姻状态的值
		maritalSelectChange(val) {
			this.maritalStatus = val;
		},
		// 选择出生年份
		selectDatePicker() {
			this.$refs['date-time'].show();
		},
		dateTimeChange(value) {
			this.birthdayYear = value;
		},
		// 选择最高学历
		hieghestEducationSelectChange(val) {
			this.hieghestEducation = val;
		},
		
		// 选择求职状态
		jobStatusSelectChange(val) {
			this.jobStatus = val;
		},
		
		// 选择置顶时间
		resumeTopTimeSelectChange(val) {
			this.resumeTopTime = val;
			console.log(this.resumeTopTime)
		},
		
		// 上传头像
		resumeAvatarUrlSelect(e) {
			// 审核选择图片
			this.checkImgReview(e.tempFilePaths[0]).then(res => {
				if (!res) {
					this.showMessage('error', '图片违规，自动删除', 'center');
					this.$refs.resumeAvatarUrl.clearFiles(-1);
				} else {
					this.uploadPersonalPicture(e.tempFilePaths[0]).then(res => {
						this.userAvatarUrl.push(...[{
									name: res.Pic,
									extname: e.tempFiles[0].extname,
									url: this.$getImgUrl(res.Imgpath),
						}])
					})
					console.log('userAvatarUrl：', this.userAvatarUrl)
				}
			});
		},
		
		// 上传图片进行审核
		checkImgReview(tempFilePath) {
			// console.log(tempFilePath[0])
			uni.showLoading({
				title: '上传中'
			});
			return this.$api
				.uploadPictureReview({
					params: {} /* 会加在url上 */,
					// #ifdef APP-PLUS || H5
					// files: [], // 需要上传的文件列表。使用 files 时，filePath 和 name 不生效。App、H5（ 2.6.15+）
					// #endif
		
					// #ifdef MP-ALIPAY
					fileType: 'image/video/audio', // 仅支付宝小程序，且必填。
					// #endif
		
					filePath: tempFilePath, // 要上传文件资源的路径。
					name: 'file_img', // 文件对应的 key , 开发者在服务器端通过这个 key 可以获取到文件二进制内容
		
					// #ifdef H5 || APP-PLUS
					timeout: 3000 // H5(HBuilderX 2.9.9+)、APP(HBuilderX 2.9.9+)
					// #endif
				})
				.then(res => {
					uni.hideLoading();
					if (res.errcode == 0) {
						return true;
					} else {
						return false;
					}
				});
		},
		// 上传图片
		uploadPersonalPicture(tempFilePath) {
			return this.$api.uploadPostResumeAvatar({
				params: {} /* 会加在url上 */,
				// #ifdef APP-PLUS || H5
				// files: [], // 需要上传的文件列表。使用 files 时，filePath 和 name 不生效。App、H5（ 2.6.15+）
				// #endif
		
				// #ifdef MP-ALIPAY
				fileType: 'image/video/audio', // 仅支付宝小程序，且必填。
				// #endif
		
				filePath: tempFilePath, // 要上传文件资源的路径。
				name: 'imgurl', // 文件对应的 key , 开发者在服务器端通过这个 key 可以获取到文件二进制内容
				// #ifdef H5 || APP-PLUS
				timeout: 3000 // H5(HBuilderX 2.9.9+)、APP(HBuilderX 2.9.9+)
				// #endif
		
				// header: {}, /* 会与全局header合并，如有同名属性，局部覆盖全局 */
				// custom: {}, // 自定义参数
				// formData: {xxid:infoId}, // HTTP 请求中其他额外的 form data
				// // 返回当前请求的task, options。请勿在此处修改options。非必填
				// getTask: (task, options) => {
				//   // setTimeout(() => {
				//   //   task.abort()
				//   // }, 500)
				// }
			})
				.then(res => {
					uni.hideLoading();
					// console.log(res);
					return res.data
					// resolve(res);
				})
				// .catch(err => {
				// 	uni.hideLoading();
				// 	console.log(err);
				// 	reject(err);
				// });
		},
		
		checkTextContent(value) {
			// console.log(value)
			if (value.length > 0) {
				this.$api.checkTextContent({ filewz: value }).then(res => {
					if (res.errcode != 0) {
						this.showMessage('error', '文字内容违规，请修改文字内容', 'center');
					}
				});
			}
		},
				
		infoSubmit() {
			this.isSubmit = true;
			// 组合提交参数
			
			// 判断组合上传头像
			if(this.userAvatarUrl.length == 0) {
				this.showMessage('warning', '请上传头像', 'center');
				this.isSubmit = false;
				return
			} else {
				// 组合上传头像参数
				this.infoParams['imgurl'] = this.userAvatarUrl[0].name
			}
			
			// 判断组合求职类型
			this.infoParams['JobType'] = this.jobType
			
			// 判断组合求职岗位
			if(this.positionClass == ''){
				this.showMessage('warning', '请选择求职岗位', 'center');
				this.isSubmit = false;
				return
			} else {
				this.infoParams['JobID1'] = this.positionClass
			}
			
			// 判断组合求职意向
			if(this.jobIntention.length == 0){
				this.showMessage('warning', '请选择求职意向', 'center');
				this.isSubmit = false;
				return
			} else {
				this.infoParams['JobID2'] = this.jobIntention.toString()
			}
			
			// 判断组合求职区域
			if(this.jobArea == ''){
				this.showMessage('warning', '请选择求职区域', 'center');
				this.isSubmit = false;
				return
			} else {
				
				this.infoParams['ProID'] = this.jobCity
				this.infoParams['CityID'] = this.jobArea
			}
			// 判断组合工作经验
			if(this.workExperience == ''){
				this.showMessage('warning', '请选择工作经验', 'center');
				this.isSubmit = false;
				return
			} else {
				this.infoParams['GZJYID'] = this.workExperience
			}
			// 判断组合期望薪资
			if(this.salaryExperience == ''){
				this.showMessage('warning', '请选择期望薪资', 'center');
				this.isSubmit = false;
				return
			} else {
				this.infoParams['XZID'] = this.salaryExperience
			}
			
			// 判断组合姓名
			if(this.userName == ''){
				this.showMessage('warning', '请输入您的姓名', 'center');
				this.isSubmit = false;
				return
			} else {
				this.infoParams['Name'] = this.userName
			}
			
			// 判断组合性别
			if(this.gender == ''){
				this.showMessage('warning', '请选择性别', 'center');
				this.isSubmit = false;
				return
			} else {
				this.infoParams['Sex'] = this.gender
			}
			
			// 判断组合婚姻状态
			if(this.maritalStatus == ''){
				this.showMessage('warning', '请选择婚姻状态', 'center');
				this.isSubmit = false;
				return
			} else {
				this.infoParams['HunYin'] = this.maritalStatus
			}
			
			// 判断组合出生年份
			if(this.birthdayYear == ''){
				this.showMessage('warning', '请选择出生年份', 'center');
				this.isSubmit = false;
				return
			} else {
				this.infoParams['BirYear'] = this.birthdayYear
			}
			
			// 判断组合最高学历
			if(this.hieghestEducation == ''){
				this.showMessage('warning', '请选择最高学历', 'center');
				this.isSubmit = false;
				return
			} else {
				this.infoParams['XuLiID'] = this.hieghestEducation
			}
			
			// 判断组合求职状态
			if(this.jobStatus == ''){
				this.showMessage('warning', '请选择求职状态', 'center');
				this.isSubmit = false;
				return
			} else {
				this.infoParams['QZZT'] = this.jobStatus
			}
			
			// 判断组合联系电话
			if(this.userPhone == ''){
				this.showMessage('warning', '请输入您的联系电话', 'center');
				this.isSubmit = false;
				return
			} else {
				this.infoParams['Phone'] = this.userPhone
			}
			
			// 判断组合简历置顶
			if(this.resumeTopTime.length == 0){
				this.showMessage('warning', '请选择简历置顶时长', 'center');
				this.isSubmit = false;
				return
			} else {
				this.infoParams['FeeID'] = this.resumeTopTime
			}
			
			// 判断组合工作经历
			if(this.workExperienceContent == ''){
				this.showMessage('warning', '请输入您的工作经历', 'center');
				this.isSubmit = false;
				return
			} else {
				this.infoParams['WorkJL'] = this.workExperienceContent
			}
			
			// 判断组合教育经历
			if(this.educationExperienceContent == ''){
				this.showMessage('warning', '请输入您的教育经历', 'center');
				this.isSubmit = false;
				return
			} else {
				this.infoParams['JiaoYuJL'] = this.educationExperienceContent
			}
			
			// 判断组合自我描述
			if(this.selfDescriptionContent == ''){
				this.showMessage('warning', '请输入您的自我描述', 'center');
				this.isSubmit = false;
				return
			} else {
				this.infoParams['ZiWoMS'] = this.selfDescriptionContent
			}
			
			
			// 判断组合简历公开范围
			this.infoParams['CKType'] = this.scopOfDisclosure
			

			console.log(this.infoParams)
			if(this.isSubmit) {
				this.$api.postJobPostResume(this.infoParams).then(res => {
					uni.$u.route('/pages/jobMe/jobMe')
				})
			}
			
			
		},
		
		showMessage(type, title, direction) {
			//显示message
			this.$refs.message.show({
				type: type, //默认default
				msg: title, //显示内容
				icon: true, //显示icon
				mask: false, //遮罩
				time: 3000, //显示时间
				direction: direction //方向
			});
			let id = this.$refs.message.id; //获取弹窗id,需要在弹出后获取
			setTimeout(() => {
				this.$refs.message.close(id); //关闭某个弹窗
			}, 3000);
			// if(this.messageData.time===false){
			// 	if(this.messageData.mask){
			// 		this.$refs.message.show({
			// 			type:'warning',
			// 			msg:'注意!! 当前遮罩已开启,不可点击,为了方便测试这里设置了10秒后关闭当前消息,你也可以关闭指定某个消息,详情查看说明文档及demo.',
			// 			time:10000
			// 		})
			// 		setTimeout(()=>{
			// 			this.$refs.message.close(id); //关闭某个弹窗
			// 		},10000)
			// 	}
			// }
		}

		
	
		
		
	},
	computed: {
		startYearValue: function() {
			let dateNow = new Date()
			return dateNow.getFullYear() - 65
		},
		endYearValue:function() {
			let dateNow = new Date()
			return dateNow.getFullYear() - 18
		}
	},
	components: {
		ldSelect,
		jpTimePicker,
		QuickMessage,
	}
};
</script>

<style lang="scss" scoped>
@import url('jobPostResume.css');
</style>
